// pages/index/index.js
const app = getApp();
Page({
  data: {
    act: 0,
    historyDisplay: false,
    userDisplay: false,
    controlDisplay: true,
  },
    onLoad: function () {
        this.setData({
            historyDisplay: false,
            userDisplay: false,
            controlDisplay: true,
        });
    },
    //接收子组件传递的数据
    updateData: function (e) {
      this.setData({
          act: e.detail.act
      });
        if (this.data.act == 0) {
            this.setData({
                historyDisplay: false,
                userDisplay: false,
                controlDisplay: true,
            });
        }
        else if (this.data.act == 1) {
            this.setData({
                historyDisplay: true,
                userDisplay: false,
                controlDisplay: false,
            });
        }
        else if (this.data.act == 2) {
            this.setData({
                historyDisplay: false,
                userDisplay: true,
                controlDisplay: false,
            });
        }
    }



});

